package com.chiyi.service;

import com.chiyi.bean.TProduct;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @date 2021/5/14 16:19
 * 容错类
 * TODO 针对方法进行容错
 */
@Service
public class ProductClientFallBack implements ProductClient {
    @Override
    public String work() {
        return "远程调用失败，进入容错";
    }

    @Override
    public List<TProduct> getAllProduct() {
        return new ArrayList<>();
    }

    @Override
    public TProduct detail(Integer id) {
        TProduct product = new TProduct();
        product.setId(-1);
        product.setPname("远程调用失败，进入容错");
        return product;
    }
}
